package com.xyzwps.lib.express.router.annotation.openapi;

import com.xyzwps.lib.openapi.element.SchemaFormat;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

@Retention(RetentionPolicy.SOURCE)
public @interface StringSchema {

    String title() default "";

    String description() default "";

    boolean deprecated() default false;

    String defaultValue() default "";

    /**
     * The format of the string. Invalid value would be ignored.
     *
     * @return the format of the string.
     */
    SchemaFormat format() default SchemaFormat.UNKNOWN;

    String example() default "";

    /**
     * The minimum length of the string. Negative value would be ignored.
     *
     * @return the minimum length of the string.
     */
    int minLength() default -1;

    /**
     * The maximum length of the string. Negative value would be ignored.
     *
     * @return the maximum length of the string.
     */
    int maxLength() default -1;

    /**
     * The regexp pattern that string value should be matched with.
     * Invalid regexp would be ignored.
     *
     * @return regexp pattern
     */
    String pattern() default "";

    boolean ignored() default false;
}
